/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Forms;

/**
 *
 * @author edwin
 */
public class MainFrame extends javax.swing.JFrame {
    
    private int cont;

    /**
     * Creates new form MainFrame
     */
    public MainFrame() {
        initComponents();
        cont=0;
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        JTextInputWeatherValue = new javax.swing.JTextField();
        JTextForescastValue = new javax.swing.JTextField();
        JButtonAddReport = new javax.swing.JButton();
        jButtonDeleteLastReport = new javax.swing.JButton();
        jButtonDeleteAll = new javax.swing.JButton();
        jButtonForecastAlgorithms = new javax.swing.JButton();
        jTextCurrentData = new javax.swing.JTextField();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Virtual Forecast");

        jLabel1.setText("Weather Report");

        jLabel2.setText("Values to Forecast");

        JTextInputWeatherValue.setText("Input weather value");

        JTextForescastValue.setText("0");
        JTextForescastValue.setToolTipText("Enter the number of days that you want to forecast");
        JTextForescastValue.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JTextForescastValueActionPerformed(evt);
            }
        });

        JButtonAddReport.setText("Add");
        JButtonAddReport.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JButtonAddReportActionPerformed(evt);
            }
        });

        jButtonDeleteLastReport.setText("Delete Last");

        jButtonDeleteAll.setText("Delete All");

        jButtonForecastAlgorithms.setText("Forecast");
        jButtonForecastAlgorithms.setEnabled(false);
        jButtonForecastAlgorithms.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonForecastAlgorithmsActionPerformed(evt);
            }
        });

        jTextCurrentData.setEditable(false);
        jTextCurrentData.setHorizontalAlignment(javax.swing.JTextField.LEFT);
        jTextCurrentData.setText("Current Data:");
        jTextCurrentData.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextCurrentDataActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel1)
                            .addComponent(jLabel2))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                .addComponent(JTextInputWeatherValue, javax.swing.GroupLayout.PREFERRED_SIZE, 196, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(23, 23, 23))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                .addComponent(JTextForescastValue, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(75, 75, 75))))
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(layout.createSequentialGroup()
                                .addGap(134, 134, 134)
                                .addComponent(jButtonForecastAlgorithms))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(JButtonAddReport)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jButtonDeleteLastReport)
                                .addGap(33, 33, 33)
                                .addComponent(jButtonDeleteAll)))
                        .addContainerGap())
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jTextCurrentData, javax.swing.GroupLayout.PREFERRED_SIZE, 366, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap())))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(24, 24, 24)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(JTextInputWeatherValue, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(23, 23, 23)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(JTextForescastValue, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(30, 30, 30)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(JButtonAddReport)
                    .addComponent(jButtonDeleteLastReport)
                    .addComponent(jButtonDeleteAll))
                .addGap(24, 24, 24)
                .addComponent(jButtonForecastAlgorithms)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jTextCurrentData, javax.swing.GroupLayout.DEFAULT_SIZE, 130, Short.MAX_VALUE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void JTextForescastValueActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JTextForescastValueActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_JTextForescastValueActionPerformed

    private void jTextCurrentDataActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextCurrentDataActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextCurrentDataActionPerformed

    private void jButtonForecastAlgorithmsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonForecastAlgorithmsActionPerformed
        // TODO add your handling code here:
        if(cont>=5) {
            this.JTextForescastValue.enable(true);
        }
    }//GEN-LAST:event_jButtonForecastAlgorithmsActionPerformed

    private void JButtonAddReportActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JButtonAddReportActionPerformed
        // TODO add your handling code here:
        cont=cont+1;
    }//GEN-LAST:event_JButtonAddReportActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new MainFrame().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton JButtonAddReport;
    private javax.swing.JTextField JTextForescastValue;
    private javax.swing.JTextField JTextInputWeatherValue;
    private javax.swing.JButton jButtonDeleteAll;
    private javax.swing.JButton jButtonDeleteLastReport;
    private javax.swing.JButton jButtonForecastAlgorithms;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JTextField jTextCurrentData;
    // End of variables declaration//GEN-END:variables
}
